<template>
	<view class="warp">
		<view class="car_park" @click="show = true;">
			{{car_number}}
			<u-icon name="arrow-down" color="#999" size="16"></u-icon>
		</view>
		
		<view class="lattice_box">
			<navigator url="" class="item item_1" hover-class="none">
				<view class="lines">
					<text class="title">今日收益</text>
					<text class="price">￥238.00</text>
				</view>
				<view class="lines">
					<text class="titles">入场/出场</text>
					<text class="nums">99 / 102</text>
				</view>
			</navigator>
			<navigator url="" class="item item_2" hover-class="none">
				<view class="lines">
					<text class="title">昨日收益</text>
					<text class="price">￥458.00</text>
				</view>
				<view class="lines">
					<text class="titles">入场/出场</text>
					<text class="nums">99 / 102</text>
				</view>
			</navigator>
		</view>
		
		<view class="all_title_box">
			<view class="title">设备列表</view>
		</view>
		<view class="facililty_box">
			<view class="item_s">
				<image src="/static/coolc/001.jpg"></image>
				<view class="viewBox">
					<view class="title">西校区侧门车场入口1车道</view>
					<view class="label">车牌识别相机 <u-button text="在线" size="mini" type="success" :hairline="true" :plain="true"></u-button></view>
				</view>
				<view class="btBox">
					<u-button type="primary" @click="btnClick" size="mini" text="远程开闸" :hairline="true" :plain="true"></u-button>
				</view>
			</view>
			<view class="item_s">
				<image src="/static/coolc/001.jpg"></image>
				<view class="viewBox">
					<view class="title">西校区侧门车场入口1车道</view>
					<view class="label">车牌识别相机 <u-button text="离线" size="mini" type="error"></u-button></view>
				</view>
				<view class="btBox">
					<u-button type="primary" @click="btnClick" size="mini" text="远程开闸" :hairline="true" :plain="true"></u-button>
				</view>
			</view>
			<view class="item_s">
				<image src="/static/coolc/001.jpg"></image>
				<view class="viewBox">
					<view class="title">西校区侧门车场入口1车道</view>
					<view class="label">车牌识别相机 <u-button text="在线" size="mini" type="success" :hairline="true" :plain="true"></u-button></view>
				</view>
				<view class="btBox">
					<u-button type="primary" @click="btnClick" size="mini" text="远程开闸" :hairline="true" :plain="true"></u-button>
				</view>
			</view>
			<view class="item_s">
				<image src="/static/coolc/001.jpg"></image>
				<view class="viewBox">
					<view class="title">西校区侧门车场入口1车道</view>
					<view class="label">车牌识别相机 <u-button text="在线" size="mini" type="success" :hairline="true" :plain="true"></u-button></view>
				</view>
				<view class="btBox">
					<u-button type="primary" @click="btnClick" size="mini" text="远程开闸" :hairline="true" :plain="true"></u-button>
				</view>
			</view>
		</view>
		
		<view class="all_title_box">
			<view class="title">现场抓拍</view>
		</view>
		<view class="album">
			<view class="album__its" v-for="(item,index) in photo" :key="index">
				<view class="album__its__content">
					<u-album 
						:urls="item.urls"
						singleSize="330rpx"
						singleMode="aspectFill"
						:previewFullImage="true"
					></u-album>
				</view>
				<u--text
					:text="item.name"
					margin="0 0 3px 0"
					size="14"
				></u--text>
				<view class="time_box">
					<text class="time">{{item.label}}</text>
					<u-icon name="reload" color="#666666" size="17"></u-icon>
				</view>
			</view>
		</view>
		
		<u-picker
			:show="show"
			:columns="columns"
			:closeOnClickOverlay="true"
			@confirm="car_confirm"
			@cancel="show = false"
			@close="show = false"
		></u-picker>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				show: false,
				car_number: "西校区公共停车场",
				columns: [
					['西校区公共停车场', '西校区职工停车场', '总校1停车场', '总校2停车场']
				],
				photo: [{
					name: "西校区侧门车场入口1车道",
					urls: [
						"/static/coolc/u610.png"
					],
					label: "2021-11-11 15:05"
				},
				{
					name: "西校区侧门车场入口1车道",
					urls: [{
						src: "/static/coolc/u610.png"
					}],
					label: "2021-11-11 15:05"
				},
				{
					name: "西校区侧门车场入口1车道",
					urls: [{
						src: "/static/coolc/u610.png"
					}],
					label: "2021-11-11 15:05"
				},
				{
					name: "西校区侧门车场入口1车道",
					urls: [{
						src: "/static/coolc/u610.png"
					}],
					label: "2021-11-11 15:05"
				}]
			}
		},
		methods: {
			car_confirm(e) {
				this.show = false;
				this.car_number = e.value[0];
			},
			btnClick() {
				uni.showToast({
				    title: '开闸请求已发送',
					icon: 'none',
				    duration: 2000
				});
			}
		}
	}
</script>

<style lang="scss">
	.warp {
		padding: 30rpx;
		background: #fff;
		border-top: 2rpx solid #f5f5f5;
	}
	.facililty_box {
		width: 690rpx;
		
		.item_s {
			width: 690rpx;
			@include flex;
			justify-content: space-between;
			align-items: center;
			padding: 26rpx 0;
			border-bottom: 2rpx solid #ededed;
			
			&:nth-child(1) {
				padding-top: 0rpx;
			}
			
			image {
				width: 90rpx;
				height: 90rpx;
				border-radius: 12rpx;
			}
			.viewBox {
				width: 470rpx;
				padding-left: 20rpx;
				
				.title {
					font-size: 30rpx;
					padding-bottom: 10rpx;
					color: #333;
				}
				.label {
					font-size: 26rpx;
					color: #999;
					@include flex;
					align-items: center;
					justify-content: flex-start;
					
					.u-button {
						margin-left: 10rpx;
						min-width: 70rpx;
						padding: 0rpx;
					}
				}
			}
			.btBox {
				
				.u-button {
					width: 148rpx;
					padding: 30rpx 0rpx;
				}
			}
		}
	}
	.album {
		@include flex;
		flex-wrap: wrap;
		align-items: flex-start;
		justify-content: space-between;
		
		&__its {
			width: 330rpx;
			
			.time_box {
				@include flex;
				justify-content: start;
				align-items: center;
				padding-bottom: 16rpx;
				
				.time {
					font-size: 26rpx;
					color: #999;
					padding-right: 14rpx;
				}
			}
			&__content {
				flex: 1;
				margin-bottom: 10rpx;
				
				.u-album {
					border-radius: 10rpx;
					overflow: hidden;
				}
			}
		}
	}
</style>
